package routers

import (
	"gin-project-01/gin-step03/gin13-session/controllers/file"
	"gin-project-01/gin-step03/gin13-session/middlewares"
	"github.com/gin-gonic/gin"
)

func FileRouters(r *gin.Engine) {
	//路由分组中间件使用方式一
	routers := r.Group("/file", middlewares.SaveAccessLog)

	{

		//上传单个文件
		routers.POST("/upload", file.FileController{}.Upload)

		//上传多个文件，文件属性名称不一致
		routers.POST("/uploadBatch01", file.FileController{}.UploadBatch01)

		//上传多个文件，文件属性名称一致
		routers.POST("/uploadBatch02", file.FileController{}.UploadBatch02)

		//上传多个文件，文件属性名称一致，按照日期存储文件
		routers.POST("/uploadBatch03", file.FileController{}.UploadBatch03)
	}
}
